package com.laiyizhan.common.mapper;

import com.laiyizhan.common.model.Seventh_message;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface Seventh_messageMapper {
    @Delete({
        "delete from seventh_message",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into seventh_message (a_level, o_name, ",
        "f_name, phone, type, ",
        "nature, city)",
        "values (#{aLevel,jdbcType=VARCHAR}, #{oName,jdbcType=VARCHAR}, ",
        "#{fName,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, ",
        "#{nature,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(Seventh_message record);

    int insertSelective(Seventh_message record);

    @Select({
        "select",
        "id, a_level, o_name, f_name, phone, type, nature, city",
        "from seventh_message",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    Seventh_message selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Seventh_message record);

    @Update({
        "update seventh_message",
        "set a_level = #{aLevel,jdbcType=VARCHAR},",
          "o_name = #{oName,jdbcType=VARCHAR},",
          "f_name = #{fName,jdbcType=VARCHAR},",
          "phone = #{phone,jdbcType=VARCHAR},",
          "type = #{type,jdbcType=VARCHAR},",
          "nature = #{nature,jdbcType=VARCHAR},",
          "city = #{city,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Seventh_message record);
}